<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}
			
			.box {
				width: 1200px;
				height: 50px;
				background-color: red;
				margin: 0 auto;
			}
		</style>
		<script type="text/javascript">
			window.onresize=function(){   //屏幕尺寸重新改变之后执行
				//设备的尺寸（分辨率）
//				console.log(window.screen.width);
				
				//浏览器窗口的尺寸
				console.log(window.document.documentElement.clientWidth);
			}
		</script>
	</head>
	<body>
		<div class="box"></div>
	</body>
</html>
